{layout name="daili/layout"}
<main class="app-content">
  <div class="app-title">

    <ul class="app-breadcrumb breadcrumb">
      <li class="breadcrumb-item"><i class="fa fa-home fa-lg"></i></li>
      <li class="breadcrumb-item">代理后台</li>
      <li class="breadcrumb-item"><a href="#">资金管理</a></li>
    </ul>
  </div>
  <div class="row">

    <div class="clearix"></div>
    <div class="col-md-12">
      <div class="tile">
        <h3 class="tile-title">生成代理邀请码:<a style="color:red"> 扣除100元余额</a> </h3>
        <div class="tile-body">

            <div class="form-group col-md-12">
              <label class="control-label"></label>
              <input id="input1" name="wallet" class="form-control" type="text" placeholder="">
            </div>
            <div class="form-group col-md-4 align-self-end">
              <button onclick="go();" class="btn btn-primary" type="button"><i class="fa fa-fw fa-lg fa-check-circle"></i>点我生成</button>
            </div>
     
        </div>
      </div>
    </div>
    <style> 
        .margin_clear{
          margin-bottom:0rem;
        }
    </style>
    <div class="col-md-12">
      <div class="tile">
        <h3 class="tile-title">我生成的邀请码</h3>
        <ul class="list-group">
           {foreach $data as $v}
          {if condition="$v->y_use == 'no'"}
          <li class="list-group-item">
            <span class="label label-default label-pill pull-right badge badge-secondary">未使用</span>
            <span> 邀请码 :   <b style="font-size: 1rem"> {$v->y_no}</b>  </span>
            <div>时间:{:date('Y-m-d H:i:s',$v.y_maketime)} </div>
          </li>

          {else/}
          <li class="list-group-item">
            <span class="label label-default label-pill pull-right badge badge-success">已使用</span>
            <span> 邀请码 :   <b style="font-size: 1rem"> {$v->y_no}</b>  </span>
            <div>时间:{:date('Y-m-d H:i:s',$v.y_maketime)}  </div>
          </li>
          
          {/if}
           {/foreach}
        </ul>
          <div style="margin-top:2rem;" id="pages">
                        </div>

                        
                        <div id="pages">
                            {$data->render()}
                        </div>
                       
                    
                        <script>  
                          $("#pages li span").attr('class','page-link');
                          $("#pages li a").each((e,q)=>{
                              console.log();
                              if(typeof( $(q).attr('class')) == 'undefined'){
                                $(q).attr('class',' page-link');
                              }else{
                                $(q).attr('class',$(q).attr('class')+' page-link');
                              }
                          })
                        </script>

      </div>
  
      <script>  

      function go() {
        $.ajax('./yaoqing.html',{
          type:'POST',
          data:'1',
          success:(data)=>{
            if(data.code == 1){
              $("#input1").val(data.msg);
            }else{
              alert(data.msg);
            }
          }
        })
      }
        $("#pages li span").attr('class','page-link');
        $("#pages li a").each((e,q)=>{
            console.log();
            if(typeof( $(q).attr('class')) == 'undefined'){
              $(q).attr('class',' page-link');
            }else{
              $(q).attr('class',$(q).attr('class')+' page-link');
            }
        })
      </script>



    </div>
  </div>
</main>